#define _CRT_SECURE_NO_WARNINGS 1
#include "string.h"

void test1() {
	string s1;
	s1.push_back('s');
	s1.append("hell");
	string s2("world");
	s1 += s2;
	s2 = s1;
	cout << s1.c_str() << endl;
	cout << s2.c_str() << endl;
}

void test2() {
	string s1("shell");
	string::iterator it = s1.begin();
	while (it != s1.end()) {
		cout << *it++ << " ";
	}
	cout << endl;

	const string s2("lib");
	string::const_iterator ity = s2.begin();
	while (ity != s2.end()) {
		cout << *ity++ << " ";
	}
	cout << endl;

	cout << s1[0] << s1[1] << s1[2] << endl;
}

void test3() {
	string s1;
	s1.push_back('s');
	s1.append("hell");

	string s2("world");
	s2.insert(0, s1);

	string s3;
	s3.insert(0, "lib holl");
	s3.erase(4);
	for (auto ch : s3) {
		cout << ch;
	}
	cout << endl;
	cout << s1.c_str() << endl;
	cout << s2.c_str() << endl;
}

void test4() {
	string s1("shell lib np");
	string s2 = s1.substr(s1.find("lib"), 3);
	cout << s2 << endl;
	string s3("abc");
	cin >> s3;
	cout << s3 << endl;
}

void test5() {
	std::string s1("zef");
	std::string s2("shell");
	cout << (s1 < s2) << endl;

	string s3("shell");
	string s4("shellaaa");
	cout << (s3 < s4) << endl;

	string s5(s3);
	cout << s5 << endl;
}

int main() {
	test5();
	return 0;
}